package org.polaris;

import org.mybatis.spring.annotation.MapperScan;
import org.polaris.authority.interceptor.AuthorityInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.ServletComponentScan;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@SpringBootApplication
@MapperScan("org.polaris")//扫描mapper
@ServletComponentScan("org.polaris.authority.listener") //扫描监听器
public class AppStart implements WebMvcConfigurer {
    @Autowired
    private AuthorityInterceptor authorityInterceptor;
    public static void main(String[] args) {
        SpringApplication.run(AppStart.class,args);
    }

/*    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(authorityInterceptor)
                .excludePathPatterns("/login","/loginOut");
    }*/
}
